<%--
  Created by IntelliJ IDEA.
  User: Lemon
  Date: 2020/6/11
  Time: 14:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <title>客户信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css" media="all">
</head>
<body>
<script type="text/html" id="operation">
    <div>无</div>
</script>
<div class="layui-tab layui-tab-brief" lay-filter="care-tab">
    <ul class="layui-tab-title">
        <li class="layui-this">7天内过生日客户</li>
        <li>15天内过生日客户</li>
        <li>30天内过生日客户</li>
    </ul>
    <div class="layui-tab-content" style="padding: 0px;">
        <div class="layui-tab-item layui-show">
            <table id="customerCareTableA" lay-filter="customerCareTableA"></table>
        </div>
        <div class="layui-tab-item">
            <table id="customerCareTableB" lay-filter="customerCareTableB"></table>
        </div>
        <div class="layui-tab-item">
            <table id="customerCareTableC" lay-filter="customerCareTableC"></table>
        </div>
    </div>
</div>


</body>
<script src="${pageContext.request.contextPath}/static/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use([ 'table', 'form', 'laydate','element' ], function() {
        var table = layui.table;
        var form = layui.form;
        var layer = layui.layer;
        var laydate = layui.laydate;
        var element =layui.element;
        var $ = layui.$;

        loadTable('customerCareTableA');

        element.on('tab(care-tab)',function(data){
            if(data.index==0){
                //7天内的生日
                loadTable('customerCareTableA');
            }else if(data.index==1){
                //15天内的生日
                loadTable('customerCareTableB');
            }else if(data.index==2){
                //30天内的生日
                loadTable('customerCareTableC');
            }
        });

        function loadTable(tableId){
            //加载表格数据
            table.render({
                elem:'#'+tableId,
                url:'/service/customerCareList',
                method:'post',
                cols:[[
                    {field : "customer_name", title : "客户或联系人"},
                    {field : "birthday", title : "生日"},
                    {field : "birthday", title : "出生日期"},
                    {field : "users_account", title : "处理人"},
                    {field : "status", title : "状态"},
                    {field : "operation", title : "操作", toolbar: '#operation'}
                ]],
                page:true, //是否开启分页
            });
        };
    });
</script>
</html>